<template>
	<view @click="goToArticle">
		<!-- 标题 -->
		<view class="margin-bottom-xs" style="font-weight: 600;">{{art.title}}</view>
		<!-- 正文 -->
		<rich-text style="overflow: hidden;display: -webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3 " :nodes="art.content"></rich-text>
		<!-- 多张图片 -->
		<view v-if="art.imglist" class="flex  margin-top margin-bottom-xs ">
			<view v-for="(img,index3) in art.imglist" :key="index3" style="width: 250rpx; height: 125rpx;">
				<image :src="img" mode="aspectFit" style="width: 100%;height: 100%;"></image>
			</view>
		</view>
		<!-- 阅读量 -->
		<view>阅读量{{art.viewCount}}</view>
	</view>
</template>

<script>
	export default {
		props: {
			art: {
				type:Object,
				default: function() {
					return {
						title: "java基础课程：test",
						imglist: [],
						viewCount: 20,
					}
				}
			}
		},
		methods:{
			goToArticle(){
				this.$Router.push({
					name:'article',
					params:{
						id:this.art.contentId,
					},
				});
			}
		},
	}
</script>

<style>
</style>
